package top.hisoft.pattern.creational.factorymethod.farm;

import top.hisoft.pattern.creational.factorymethod.farm.factory.AppleFactory;
import top.hisoft.pattern.creational.factorymethod.farm.factory.GrapeFactory;
import top.hisoft.pattern.creational.factorymethod.farm.factory.StrawberryFactory;

/**
 * 客户
 *
 * @author sky
 */
public class Client {

    public static void main(String[] args) {
        FruitFactory appleFactory = new AppleFactory();
        Fruit appleFruit = appleFactory.createFruit();
        appleFruit.grow();

        FruitFactory grapeFactory = new GrapeFactory();
        Fruit grapeFruit = grapeFactory.createFruit();
        grapeFruit.harvest();

        FruitFactory strawberryFactory = new StrawberryFactory();
        Fruit strawberryFruit = strawberryFactory.createFruit();
        strawberryFruit.plant();
    }
}
